<template>
  <div class="header_box">
    <div class="tabs">
      <div
        class="tabs_text"
        :class="{ tabs_text_color: Current == index }"
        @click="setTabs(index)"
        v-for="(item, index) in tabsList"
        :key="index"
      >
        {{ item.name }}
        <div class="icon" v-if="item.icon">></div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  name: "header",
  props: {
    // CurrentNum: {
    //   type: Number,
    //   default: function() {
    //     return 0;
    //   },
    // },
  },
  watch: {
    // 监听 prop 的变化，以更新本地的 data 属性
    // CurrentNum(newVal) {
    //   this.Current = newVal;
    // },
  },
  data() {
    return {
      Current: 0,
      tabsList: [
        {
          name: "海优招聘",
          icon: true,
          value: "",
        },
        {
          name: "申请准备",
          icon: true,
          value: "",
        },
        {
          name: "撰写申请书",
          icon: true,
          value: "",
        },
        {
          name: "会评答辩",
          icon: true,
          value: "",
        },
        {
          name: "入职",
          icon: false,
          value: "",
        },
      ],
    };
  },
  methods: {
    setTabs(indx) {
      this.Current = indx;
      this.$emit("Currenttabs", indx);
    },
  },
};
</script>

<style scoped>
.header_box {
  margin: 0 auto;
  width: 1920px;
  border: 1px solid #fff;
  background-color: #fff;
  display: flex;
  align-items: center;
  box-sizing: border-box;
}

.tabs {
  width: 1920px;
  height: 77px;
  border: 1px solid #fff;
  background-color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #dedede;
  padding: 0 309px;
}
.tabs_text {
  font-style: normal;
  font-family: "SourceHanSansSC, SourceHanSansSC";
  font-weight: 500;
  font-size: 24px;
  padding: 23px;
  color: #000;
  cursor: pointer;
  position: relative;
}
.icon {
  width: 12px;
  height: 20px;
  color: #b2b2b2;
  position: absolute;
  top: 30%;
  right: -25%;
}
.tabs_text_color {
  font-family: "SourceHanSansSC, SourceHanSansSC";
  font-weight: 500;
  font-size: 24px;
  color: #0365fe;
  padding: 23px;
  border-bottom: 4px solid #0365fe;
  cursor: pointer;
}
</style>
